{
  LW Surf -- LightWave Surfaces

  This global allows you to get information about surfaces and surface parameters.

  Based on lwsurf.h which is:
  Copyright 1999, NewTek, Inc.
}

{
  Copyright 2012, Jameel Halabi

  This unit is part of the BlaiseWave wrapper,
  which is licensed under the BSD 2-Clause license (see licenses/license.txt).
}

unit LW_Surf;

{$mode objfpc}{$H+}

interface

uses
  LW_Types      ,
  LW_Render     ,
  LW_Txtr       ,
  LW_Envel      ,
  LW_Image      ,
  LW_NodeEditor ;

const
  LWSURFACEFUNCS_GLOBAL = 'Surface Functions 4' ;

  SURF_COLR = 'BaseColor'            ;
  SURF_LUMI = 'Luminosity'           ;
  SURF_DIFF = 'Diffuse'              ;
  SURF_SPEC = 'Specularity'          ;
  SURF_REFL = 'Reflectivity'         ;
  SURF_TRAN = 'Transparency'         ;
  SURF_TRNL = 'Translucency'         ;
  SURF_RIND = 'IOR'                  ;
  SURF_BUMP = 'Bump'                 ;
  SURF_GLOS = 'Glossiness'           ;
  SURF_BUF1 = 'SpecialBuffer1'       ;
  SURF_BUF2 = 'SpecialBuffer2'       ;
  SURF_BUF3 = 'SpecialBuffer3'       ;
  SURF_BUF4 = 'SpecialBuffer4'       ;
  SURF_SHRP = 'DiffuseSharpness'     ;
  SURF_BDRP = 'BumpDropoff'          ;
  SURF_SMAN = 'SmoothingAngle'       ;
  SURF_RSAN = 'ReflectionSeamAngle'  ;
  SURF_TSAN = 'RefractionSeamAngle'  ;
  SURF_RBLR = 'ReflectionBlurring'   ;
  SURF_TBLR = 'RefractionBlurring'   ;
  SURF_CLRF = 'ColorFilter'          ;
  SURF_CLRH = 'ColorHighlights'      ;
  SURF_ADTR = 'AdditiveTransparency' ;
  SURF_AVAL = 'AlphaValue'           ;
  SURF_GVAL = 'GlowValue'            ;
  SURF_LCOL = 'LineColor'            ;
  SURF_LSIZ = 'LineSize'             ;
  SURF_ALPH = 'AlphaOptions'         ;
  SURF_RFOP = 'ReflectionOptions'    ;
  SURF_TROP = 'RefractionOptions'    ;
  SURF_SIDE = 'Sidedness'            ;
  SURF_NVSK = 'ExcludeFromVStack'    ;
  SURF_GLOW = 'Glow'                 ;
  SURF_LINE = 'RenderOutlines'       ;
  SURF_RIMG = 'ReflectionImage'      ;
  SURF_TIMG = 'RefractionImage'      ;
  SURF_VCOL = 'VertexColoring'       ;
  SURF_NORM = 'VertexNormal'         ;

type

  PPLWSurface = ^PLWSurface ;
  PLWSurface  = Pointer     ;

  PPLWSurfLib = ^PLWSurfLib ;
  PLWSurfLib  = Pointer     ;


  PLWSurfaceFuncs = ^TLWSurfaceFuncs ;
  TLWSurfaceFuncs = record
    Create        : function
                    ( const ObjName  : PChar ;
                      const SurfName : PChar       ) : PLWSurface   ;
    First         : function
                    ( const Void                   ) : PLWSurface   ;
    Next          : function
                    (       SurfID   : PLWSurface  ) : PLWSurface   ;
    ByName        : function
                    ( const Name     : PChar       ;
                      const ObjName  : PChar       ) : PPLWSurface  ;
    ByObject      : function
                    ( const Name     : PChar       ) : PPLWSurface  ;
    Name          : function
                    (       SurfID   : PLWSurface  ) : PChar        ;  // const
    SceneObject   : function
                    (       SurfID   : PLWSurface  ) : PChar        ;  // const

    GetInt        : function
                    (       SurfID   : PLWSurface  ;
                      const Channel  : PChar       ) : Integer      ;
    GetFlt        : function
                    (       SurfID   : PLWSurface  ;
                      const Channel  : PChar       ) : PDouble      ;
    GetEnv        : function
                    (       SurfID   : PLWSurface  ;
                      const Channel  : PChar       ) : PLWEnvelope  ;
    GetTex        : function
                    (       SurfID   : PLWSurface  ;
                      const Channel  : PChar       ) : PLWTexture   ;
    GetImg        : function
                    (       SurfID   : PLWSurface  ;
                      const Channel  : PChar       ) : PLWImage     ;

    ChanGrp       : function
                    (       SurfID   : PLWSurface  ) : PLWChanGroup ;
    GetColorVMap  : function
                    (       SurfID   : PLWSurface  ) : PChar	    ;  // const
    SetColorVMap  : procedure
                    (       SurfID   : PLWSurface  ;
                      const VMapName : PChar       ;
                            VMapType : Integer     ) ;

    CreateLib     : function
                    ( const Void                   ) : PLWSurfLib   ;
    DestroyLib    : procedure
                    (       Lib      : PLWSurfLib  ) ;
    CopyLib       : procedure
                    (       LibTo    : PLWSurfLib  ;
                            LibFrom  : PLWSurfLib  ) ;
    ObjectLib     : function
                    ( const ObjName  : PChar       ) : PLWSurfLib   ;
    LoadLib       : function
                    ( const Name     : PChar       ) : PLWSurfLib   ;
    SaveLib       : function
                    (       LibID    : PLWSurfLib  ;
                      const Name     : PChar       ) : PLWError     ;
    SLibCount     : function
                    (       LibID    : PLWSurfLib  ) : Integer      ;
    SLibByIndex   : function
                    (       LibID    : PLWSurfLib  ;
                            Index    : Integer     ) : PLWSurface   ;
    GetNodeEditor : function
                    (       SurfID   : PLWSurface  ) : PNodeEditor  ;

    SetInt        : function
                    (       SurfID   : PLWSurface  ;
                      const Channel  : PChar       ;
                            Value    : Integer     ) : Integer      ;
    SetFlt        : function
                    (       SurfID   : PLWSurface  ;
                      const Channel  : PChar       ;
                            Value    : PDouble     ) : Integer      ;
    SetEnv        : function
                    (       SurfID   : PLWSurface  ;
                      const Channel  : PChar       ;
                            EnvelopeID : PLWEnvelope ) : Integer      ;
    SetTex        : function
                    (       SurfID   : PLWSurface  ;
                      const Channel  : PChar       ;
                            TextureID : PLWTexture ) : Integer      ;
    SetImg        : function
                    (       SurfID   : PLWSurface  ;
                      const Channel  : PChar       ;
                            ImageID  : PLWImage    ) : Integer      ;
    Rename        : function
                    (       SurfID   : PLWSurface  ;
                      const Channel  : PChar       ) : Integer      ;
    Copy          : function
                    (       SurfIDTo : PLWSurface  ;
                            SurfIDFrom : PLWSurface) : Integer      ;

    CopyLibByName : procedure
                    (       LibIDTo  : PLWSurfLib  ;
                            LibIDFrom : PLWSurfLib ) ;
    GetNormalVMap : function
                    (       SurfID   : PLWSurface  ) : PChar        ;  // const
  end;

implementation

end.

